/*    */ package scripting.quest;
/*    */ 
/*    */ import client.MapleClient;
/*    */ import constants.ScriptType;
/*    */ import handling.opcode.EffectOpcode;
/*    */ import java.awt.Point;
/*    */ import javax.script.Invocable;
/*    */ import scripting.npc.NPCConversationManager;
/*    */ import server.quest.MapleQuest;
/*    */ import tools.packet.EffectPacket;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class QuestActionManager
/*    */   extends NPCConversationManager
/*    */ {
/*    */   private final int quest;
/*    */   private final boolean start;
/*    */   private final ScriptType type;
/*    */   
/*    */   public QuestActionManager(MapleClient c, int npc, int quest, boolean start, ScriptType type, Invocable iv) {
/* 27 */     super(c, npc, String.valueOf(quest), type, iv);
/* 28 */     this.quest = quest;
/* 29 */     this.start = start;
/* 30 */     this.type = type;
/*    */   }
/*    */   
/*    */   public int getQuest() {
/* 34 */     return this.quest;
/*    */   }
/*    */   
/*    */   public boolean isStart() {
/* 38 */     return this.start;
/*    */   }
/*    */ 
/*    */   
/*    */   public void dispose() {
/* 43 */     QuestScriptManager.getInstance().dispose(this, getClient());
/*    */   }
/*    */   
/*    */   public void forceStartQuest() {
/* 47 */     MapleQuest.getInstance(this.quest).forceStart(getPlayer(), getNpc(), null);
/*    */   }
/*    */   
/*    */   public void forceStartQuest(String customData) {
/* 51 */     MapleQuest.getInstance(this.quest).forceStart(getPlayer(), getNpc(), customData);
/*    */   }
/*    */   
/*    */   public void forceCompleteQuest() {
/* 55 */     MapleQuest.getInstance(this.quest).forceComplete(getPlayer(), getNpc());
/*    */   }
/*    */   
/*    */   public String getQuestCustomData() {
/* 59 */     return getPlayer().getQuestNAdd(MapleQuest.getInstance(this.quest)).getCustomData();
/*    */   }
/*    */   
/*    */   public void setQuestCustomData(String customData) {
/* 63 */     getPlayer().getQuestNAdd(MapleQuest.getInstance(this.quest)).setCustomData(customData);
/*    */   }
/*    */   
/*    */   public void showCompleteQuestEffect() {
/* 67 */     getPlayer().getClient().announce(EffectPacket.showSpecialEffect(EffectOpcode.UserEffect_QuestComplete.getValue()));
/* 68 */     getPlayer().getMap().broadcastMessage(getPlayer(), EffectPacket.showForeignEffect(getPlayer().getId(), EffectOpcode.UserEffect_QuestComplete.getValue()), false);
/*    */   }
/*    */   
/*    */   public final void spawnNpcForPlayer(int npcId, int x, int y) {
/* 72 */     getMap().spawnNpcForPlayer(getClient(), npcId, new Point(x, y));
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\scripting\quest\QuestActionManager.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */